package com.project.bookstore.common.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

@Component
public class GlobalPasswordEncoder {
    @Autowired
    private PasswordEncoder passwordEncoder;

    public String encode(String password){
       return passwordEncoder.encode(password);
    }

    public boolean match(String password,String encodedPassword){
        return passwordEncoder.matches(password,encodedPassword);
    }
}
